package net.neptech.model.schedule;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.GenericGenerator;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @Author HuangZhengmin
 * @desc  工作量表实体类
 * @Date 2025/8/12 17:25
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sche_workload")
public class ScheWorkload implements Serializable {
    @Serial
    private static final Long serialVersionUID = 1L;

  @Id
  @GenericGenerator(name = "snowflake", type = SnowflakeIdGenerator.class)
  @GeneratedValue(generator = "snowflake")
  @Column(name = "workload_id", nullable = false)
  private Long workloadId; // 工作量ID

  @Column(name = "user_id")
  private Long userId; // 用户ID

  @Column(name = "year")
  private Integer year; // 统计年份

  @Column(name = "month")
  private Integer month; // 统计月份

  @Column(name = "total_days")
  private Integer totalDays = 0; // 当月总工作天数

  @Column(name = "week_days")
  private Integer weekDays = 0; // 当月工作日天数

  @Column(name = "night_shifts")
  private Integer nightShifts = 0; // 当月夜班次数

  @Column(name = "day_shifts")
  private Integer dayShifts = 0; // 当月白班次数

  @Column(name = "evening_shifts")
  private Integer eveningShifts = 0; // 当月晚班次数

  @Column(name = "actual_hours", precision = 10, scale = 2)
  private BigDecimal actualHours = BigDecimal.ZERO; // 当月实际工作时长

  @Column(name = "overtime_hours", precision = 10, scale = 2)
  private BigDecimal overtimeHours = BigDecimal.ZERO; // 当月加班时长

  @Column(name = "create_time")
  private Date createTime; // 创建时间

  @Column(name = "update_time")
  private Date updateTime; // 更新时间
}
